
# 使用程序创建文件
add_executable(MakeInfo geninfo.c)

# add the command to generate the source code
add_custom_command (
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/info.h
  COMMAND MakeInfo ${CMAKE_CURRENT_BINARY_DIR}/info.h
  DEPENDS MakeInfo
)

# add the binary tree directory to the search path for 
# include files
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )

message(STATUS "current source dir ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "current bin dir ${CMAKE_CURRENT_BINARY_DIR}")


configure_file(
	"${PROJECT_SOURCE_DIR}/myMath/myMath.h.in"
	"${PROJECT_BINARY_DIR}/myMath/myMath.h"
	)

add_library(myMath SHARED mysqrt.c ${CMAKE_CURRENT_BINARY_DIR}/info.h)

install (TARGETS myMath DESTINATION lib)
install (FILES ${PROJECT_BINARY_DIR}/myMath/myMath.h DESTINATION include)

